/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */
#ifndef PLPROCESSOR_STATE_PRIVATE_H
#define PLPROCESSOR_STATE_PRIVATE_H

#include <machine/pc/processor/x86/taskstatesegment.h>

/**
 * Processor state and information that was saved for every processor.
 */
class ProcessorState {
public:
	/**
	 * Constructor.
	 */
	ProcessorState() {}
	/**
	 * Get the current task state segment from the processor.
	 *
	 * @return The task state segment.
	 */
	inline TaskStateSegment *taskStateSegment();
	/**
	 * Set the task state segment for the processor.
	 *
	 * @param tss The new task state segment.
	 */
	inline void setTaskStateSegment(TaskStateSegment *tss);
	/**
	 * Get the current task state segment selector from the processor.
	 *
	 * @return The task state segment selector.
	 */
	inline uint16_t taskStateSegmentSelector();
	/**
	 * Set the task state segment selector for the processor.
	 *
	 * @param tss The new task state segment selector.
	 */
	inline void setTaskStateSegmentSelector(uint16_t tss);
private:
	// Pointer to this processor's Task-State-Segment
	TaskStateSegment *m_Tss;
	// The Task-State-Segment selector of that Processor
	uint16_t m_TssSelector;
};

TaskStateSegment *ProcessorState::taskStateSegment() {
	return m_Tss;
}

void ProcessorState::setTaskStateSegment(TaskStateSegment *tss) {
	m_Tss = tss;
}

uint16_t ProcessorState::taskStateSegmentSelector() {
	return m_TssSelector;
}

void ProcessorState::setTaskStateSegmentSelector(uint16_t tss) {
	m_TssSelector = tss;
}

#endif
